Contents | Index | < Browse | Browse >
LETTERsetvbufULETTER
Sets the buffer for a file.
Overview
#include <stdio.h>
r = setvbuf(f,buf,mode,size);
int r;
FILE *f;
char *buf;
int mode;
unsigned size;
Portability
ANSI
Description
Sets a data buffer "buf" with the size "size" for the file "f". "mode" is
used to describe the way the file should be buffered:
_IOFBF sets full buffering, that is, physical output will only occur when
the buffer is full.
_IOLBF sets line buffering, that is, physical output occurs as soon as a
linefeed is encountered (or, of course, if the buffer is full).
_IONBF disables buffering at all, that is, physical output will occur
immediately at any read or write operation.